﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Integrador
{
    public class Estado
    {
        #region Propiedades

        public double phi { get; set; }
        public double theta { get; set; }
        public double psi { get; set; }
        public double P { get; set; }
        public double Q { get; set; }
        public double R { get; set; }
        public double X { get; set; }
        public double Y { get; set; }
        public double Z { get; set; }
        public double U { get; set; }
        public double V { get; set; }
        public double W { get; set; }


        #endregion

        #region Constuctores
        public Estado()
        {
        }
        public Estado(double phi, double theta, double psi, double P, double Q, double R, double X, double Y, double Z, double U, double V, double W)
        {
            this.phi = phi;
            this.theta = theta;
            this.psi = psi;
            this.P = P;
            this.Q = Q;
            this.R = R;
            this.X = X;
            this.Y = Y;
            this.Z = Z;
            this.U = U;
            this.V = V;
            this.W = W;

        }
        #endregion

        #region Metodos


        #endregion
    }
    public class ColeccionEstados : List<Estado>
    {
        /// <summary>
        /// Suma todos los estados de la coleccion
        /// </summary>
        /// <returns>Estado con la suma de toda la coleccion</returns>
        public Estado Suma()
        {
            Estado result = new Estado(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
            foreach (Estado es in this)
            {
                result.Z = result.Z + es.Z;
                result.Y = result.Y + es.Y;
                result.X = result.X + es.X;
                result.W = result.W + es.W;
                result.V = result.V + es.V;
                result.U = result.U + es.U;
                result.theta = result.theta + es.theta;
                result.R = result.R + es.R;
                result.Q = result.Q + es.Q;
                result.psi = result.psi + es.psi;
                result.phi = result.phi + es.phi;
                result.P = result.P + es.P;
            }
            return result;
        }
    }
}
